package com.itheima.mytest;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;

public class Test09 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //1.创建反序列化的对象
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("myio\\copy.txt"));

        //2.读取数据
        ArrayList<Student1> list = (ArrayList<Student1>) ois.readObject();

        for (Student1 stu : list) {
            System.out.println(stu);
        }

        //3.释放资源
        ois.close();
    }
}
